#include "StdAfx.h"
#include "PAD_map.h"

#define KeyPressed(key) (GetAsyncKeyState(key)&0x8000)

u16 PAD_Read( void )
{
	u16 keys = 0;

	if (KeyPressed('A'))
		keys |= PAD_BUTTON_A;

	if (KeyPressed('B')) 
		keys |= PAD_BUTTON_B;

	if (KeyPressed('W')) 
		keys |= PAD_BUTTON_SELECT;

	if (KeyPressed('Q')) 
		keys |= PAD_BUTTON_START;

	if (KeyPressed(VK_RIGHT)) 
		keys |= PAD_KEY_RIGHT;

	if (KeyPressed(VK_LEFT)) 
		keys |= PAD_KEY_LEFT;

	if (KeyPressed(VK_UP)) 
		keys |= PAD_KEY_UP;

	if (KeyPressed(VK_DOWN)) 
		keys |= PAD_KEY_DOWN;

	if (KeyPressed('R')) 
		keys |= PAD_BUTTON_R;

	if (KeyPressed('L')) 
		keys |= PAD_BUTTON_L;

	if (KeyPressed('X')) 
		keys |= PAD_BUTTON_X;

	if (KeyPressed('Y')) 
		keys |= PAD_BUTTON_Y;

	return keys;
}

BOOL PAD_DetectFold( void )
{
	return FALSE;
}
